<?php $this->load->view('layout/Header'); ?>
    
    <div id="mainContent" class="floatFix">
        
    	<div class="lCol">
			<?php $this->load->view('public_bookings/links',$links_list); ?>		
        	<?php $this->load->view('layout/flashdata'); ?>
            
           	<h2>Step 2 : User details</h2>
			
			<?php 
				echo validation_errors(); 
				if($this->session->userdata('user_logged_in'))
				{
					$disable = "disabled = \"disabled\"";
					echo "You are logged in, if you want to change these informations please edit <a href='#'>your profil</a>.";
				}
				else	
					$disable = "";
			?>
            
            <form action="<?php echo site_url("public_bookings/step2"); ?>" method="post">
                <ul class="formContainer">
                    <li class="floatFix">
                        <label>First Name <span class="required">*</span></label>
						<input type="text" <?php echo $disable; ?> name="booking_first_name" id="booking_first_name" value="<?php echo set_value('booking_first_name',$this->session->userdata('booking_first_name')); ?>" />
                    </li>
                    <li class="floatFix">
                        <label>Last Name <span class="required">*</span></label>
						<input type="text" <?php echo $disable; ?> name="booking_last_name" id="booking_last_name" value="<?php echo set_value('booking_last_name',$this->session->userdata('booking_last_name')); ?>" />
                    </li>            
                    <li class="floatFix">
                        <label>Sex <span class="required">*</span></label>
						<?php 
							$bool1 = TRUE;
							$bool2 = FALSE;
							if($this->session->userdata('booking_sex') == 'M') $bool1 = TRUE;
							elseif($this->session->userdata('booking_sex') == 'F') {$bool1 = FALSE; $bool2 = TRUE; }							
						?>
						<input type="radio" <?php echo $disable; ?> class="radio" name="booking_sex" id="booking_sex" value="M" <?php echo set_radio('booking_sex', 'M', $bool1); ?> /> <div>M</div>
						<input type="radio" <?php echo $disable; ?> class="radio" name="booking_sex" id="booking_sex" value="F" <?php echo set_radio('booking_sex', 'F', $bool2); ?> /> <div>F</div>
                    </li>            	
                    <li class="floatFix">
                        <label>Nationality <span class="required">*</span></label>
						<?php
							if( (!isset($_POST["booking_nationality"])) && (!$this->session->userdata('booking_nationality')) ) $select =  "Scottish";						
							elseif ($this->session->userdata('booking_nationality')) $select = $this->session->userdata('booking_nationality');
							elseif (isset($_POST["booking_nationality"])) $select = $_POST["booking_nationality"];
						?>
						<?php echo dropdown_nationalities("booking_nationality",$select, TRUE);?>	
                    </li>            	
                    <li class="floatFix">
                        <label>E-mail address <span class="required">*</span></label>
                        <input type="text" <?php echo $disable; ?> name="booking_email" id="booking_email" value="<?php echo set_value('booking_email',$this->session->userdata('booking_email')); ?>" />
                    </li>
                    <li class="floatFix">
                        <label>Telephone number <span class="required">*</span></label>
                        <input type="text" <?php echo $disable; ?> name="booking_phone" id="booking_phone" value="<?php echo set_value('booking_phone',$this->session->userdata('booking_phone')); ?>" />
                    </li>                    
                    <li class="floatFix">
                        <label>Address </label>
                        <textarea name="booking_address" <?php echo $disable; ?> id="booking_address"><?php echo set_value('booking_address',$this->session->userdata('booking_address')); ?></textarea>
                    </li>     
					<li class="floatFix">
                        <label>City </label>
                        <input type="text" <?php echo $disable; ?> name="booking_city" id="booking_city" value="<?php echo set_value('booking_city',$this->session->userdata('booking_city')); ?>" />
                    </li>     					
                    <li class="floatFix">
                        <label>Post Code </label>
                        <input type="text" <?php echo $disable; ?> name="booking_post_code" id="booking_post_code" value="<?php echo set_value('booking_post_code',$this->session->userdata('booking_post_code')); ?>" />
                    </li>   
                    <li class="floatFix">
                        <label>Country <span class="required">*</span></label>
						<?php
							if( (!isset($_POST["booking_country"])) && (!$this->session->userdata('booking_country')) ) $select =  "United Kingdom";						
							elseif ($this->session->userdata('booking_country')) $select = $this->session->userdata('booking_country');
							elseif (isset($_POST["booking_country"])) $select = $_POST["booking_country"];
						?>						
   					    <?php echo dropdown_countries("booking_country",$select, TRUE);?>	
                    </li> 		
                    <li class="floatFix">
                        <label>Marketing </label>
						<?php 
							if ( (isset($_POST["booking_marketing"])) && ($_POST["booking_marketing"] = "1") ) $selected = "checked=\"checked\"";
							elseif($this->session->userdata('booking_marketing') == '1') $selected = "checked=\"checked\"";
							else $selected="";
						?>						
                        <input type="checkbox" <?php echo $disable; ?> name="booking_marketing" id="booking_marketing" value="1" <?php echo $selected; ?> /> 
                    </li>  					
                    <li class="floatFix">
                        <input type="submit" class="submitButton" value="Continue >>" name="go_to_step3" id="go_to_step3" />
                    </li>
                </ul>
            </form>
        
        </div>
        
        <div class="rCol">
        	<h2>Sidebar</h2>
        </div>
        
    </div>
    
<?php $this->load->view('layout/Footer'); ?>